﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

    public class CHITIETPHIEUNHAP_BUSSINESS
    {
        public DataSet ListCHITIETPHIEUNHAP(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "LIST";
            return CHITIETPHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, hx);
        }
        public DataSet LISTCHITIETPHIEUNHAPTHEOID_PN(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "LISTBY_IDPN";
            return CHITIETPHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, hx);
        }
        public DataSet TONKHO(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "TONKHO";
            return CHITIETPHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, hx);
        }
        public DataSet DONGIA(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "DONGIA";
            return CHITIETPHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, hx);
        }
        public void ThemCHITIETPHIEUNHAP(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "INSERT";
            CHITIETPHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public void SuaCHITIETPHIEUNHAP(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "UPDATE";
            CHITIETPHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public void LuuCHITIETPHIEUNHAP(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "SAVE";
            CHITIETPHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public void XoaCHITIETPHIEUNHAP(CHITIETPHIEUNHAP_ENTITY hx)
        {
            string ACTION = "DELETE";
            CHITIETPHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }

        public Hashtable HashListCHITIETPHIEUNHAP(CHITIETPHIEUNHAP_ENTITY ot)
        {
            string ACTION = "LIST";
            Hashtable ht = new Hashtable();
            DataSet ds = CHITIETPHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, ot);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ht.Add(dr["ID"], dr["ID"]);
                }
            }
            return ht;
        }
    }
